A wide variety of implantable medical devices are provided for surgical implantation into humans or animals. One common example is the cardiac pacemaker. Another is the implantable cardioverter defibrillator (ICD). State of the art implantable medical devices often include a programmable microcontroller for controlling the functions of the device to detect medical conditions within the patient in which the device is implanted and to control delivery of appropriate therapy. Within a pacemaker, for example, the microcontroller monitors the detection of P-waves and R-waves within electrical heart signals to determine whether an episode of bradycardia has occurred and, if so, controls a pulse generator to generate pacing pulses for delivery to the heart. Within an ICD, for example, the microcontroller analyzes P-waves, R-waves and other electrical signals of the heart to determine if an episode of ventricular fibrillation has occurred and, if so, controls a shocking circuit to generate a defibrillation shock for delivery to the heart. In addition to performing functions directed to deliver of therapy, the microcontroller coordinates all other functions of the implantable device such as: monitoring a battery of the device to determine if the battery needs to be replaced; switching of the mode of operation of the device from, for example, a single-chambered pacing mode to a dual-chambered pacing mode; and recording events such as detection of P-waves and R-waves for diagnostic purposes.
The microcontroller operates using control software and data stored in a memory system of the implantable device. The control software specifies the operations to be performed by the microcontroller. The control data provides parameters for controlling the software, such as parameters specifying the amount of electrical energy to employ for pacing pulses or defibrillation shocks or specifying whether the device is to operate in a dual-chamber or a single-chamber mode. The memory system also stores diagnostic information for subsequent transmission to an external programmer device for review by physicians or other personnel. The diagnostic information may include patient diagnostic data such as digitized recordings of internal electrogram (IEGM) signals and device diagnostic data such as measured battery voltages, lead impedances, and the like. Data stored in the memory system, including the control software, is stored in binary form, i.e. the data is stored as sequences of bits comprising ones or zeros. State of the art devices have memory systems storing one megabyte or more of binary data wherein a byte comprises eight bits of binary data.
Significant problems can arise if an error occurs in the control software or other data stored within the memory system. Errors can occur, for example, as a result of alpha particles striking the memory or as a result of atmospheric neutron flux, either of which can cause one or more of the individual binary values stored in the memory system to flip from a one to zero or vice versa. If the error occurs in the portion of the memory storing control software, the microcontroller might no longer be able to operate correctly and, as a result, might administer therapy when none is required or fail to administer therapy when it is required. In some cases, an error in the control software might prevent the microcontroller from operating at all, resulting in a complete lack of therapy. If the error occurs in the portion of the memory storing the control parameters, the microcontroller will likely continue to operate but might implement an incorrect mode of operation (such as performing single-chamber pacing instead of dual-chamber pacing) or might apply too much or too little electrical energy in pacing or defibrillation pulses. Errors occurring in the portion of the memory storing diagnostic information can result in a subsequent misdiagnosis of medical conditions within the patient by a physician reviewing the data or can result in a failure to properly determine when batteries or leads of the implanted device need to be replaced.
As can be appreciated, there is a significant need to provide reliable error detection and correction techniques for automatically detecting and correcting errors occurring within the memory system to ensure that the microcontroller performs the correct functions using the correct control parameters and stores the correct diagnostic data. Preferably, errors are detected and corrected promptly to ensure that the errors do not affect the delivery of therapy. Ideally, an error detection and correction system is provided that can examine data as it is read from memory to immediately detect and correct any errors found therein such that the microcontroller is never at risk of receiving erroneous data. Also, ideally, the error detection and correction system is capable of detecting and correcting either single bit or multiple bit errors. However, to achieve immediate detection and correction of single- or multiple-bit errors, the error detection and correction system typically needs to be implemented entirely in hardware to ensure quick operation and typically must devote a large percentage of the total memory space to error detection and correction bits. To this end, an error detection and correction system could be provided employing five error detection and correction bits for each eight-bit byte of actual data. By providing five error detection and correction bits per byte, single or multiple-bit errors can be detected and corrected using hardware as the data is read. However, the error detection and correction overhead necessitated by such as system is 62.5% (i.e. 13 total bits per byte/8 data bits per byte*100). In other words, fully 38.5% of the memory of the implantable device is devoted to error detection and correction bits and only 61.5% of the memory actually stores useable data, such as control software, control parameters, or diagnostic data. The many error detection and correction bits consume considerable circuit space within the implantable device and consume considerable power and thereby significantly and adversely affect the size, cost and longevity of the implantable device. Moreover, to provide the error detection and correction just described, the device would need to be designed and manufactured using thirteen-bit memory chips. Hence, implantable devices that have already been implanted cannot easily be upgraded to provide error detection and correction. For at least these reasons, error detection and correction systems of the type described are typically not implemented within implantable medical devices. Instead, some implantable devices perform only error detection, but no correction, or perform no error detection or correction whatsoever.
Accordingly, it would be highly desirable to provide an improved error detection and correction system for use within an implantable medical device, which achieves an adequate degree of error detection and correction with minimal overhead to thereby reduce the amount of memory space required to implement error detection and correction and to also reduce the amount of power consumed. It would also be highly desirable to provide an embodiment of the improved error detection and correction system that can be implemented entirely in software so that medical devices that have already been implanted can be upgraded to provide error detection and correction merely by loading new software into the device. It is to these ends that aspects of the invention are primarily directed.